//
//  UIColor+lvfj.m
//  lvfj
//
//  Created by 吕飞俊 on 15/9/25.
//  Copyright © 2015年 Goudu KuaiEx Technology(Shenzhen)Co.,ltd. All rights reserved.
//

#import "UIColor+lvfjHelper.h"

@implementation UIColor (lvfjHelper)

/**rbg*/
+(instancetype)colorWith0xRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha{
    return [UIColor colorWithRed:red/255 green:green/255 blue:blue/255 alpha:alpha];
}

/**色值*/
+(instancetype)colorWith0xRGB:(NSUInteger)rgb{
    return [self colorWith0xRGB:rgb alpha:1.0];
}

/**色值+透明度*/
+(instancetype)colorWith0xRGB:(NSUInteger)rgb alpha:(CGFloat)alpha{
    CGFloat red = ((rgb >> 16) & 0xFF) / 255.0;
    CGFloat green = ((rgb >> 8) & 0xFF) / 255.0;
    CGFloat blue = (rgb & 0xFF) / 255.0;
    return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
}

@end
